Since ExitToShell automatically calls ExitMovies for you, you can avoid some of the problems that developers have with disposing of movie structures improperly and in the wrong order. Letting ExitToShell do the final cleanup avoids these problems, because the entire A5 world and heap is disposed of as well.
If you currently have nested EnterMovies and ExitMovies calls, this is what we recommend:
1. If you're writing an application, and you call EnterMovies, but don't call ExitMovies, any external that uses the same A5 world and calls EnterMovies and ExitMovies increments the counter and then decrements the counter and does nothing else.
2. If you're writing an external that runs under someone else's application, you have two choices:
A. Call EnterMovies, but never call ExitMovies. This causes QuickTime to initialize once during the first call to any of your externals.
B. Call EnterMovies at the beginning of each external and ExitMovies at the end
of each external. Be aware that this can waste a lot of CPU time if the main
application (or something else in the A5 world) doesn't call EnterMovies first,
since each of the EnterMovies calls in your externals requires QuickTime to
reinitialize. This can be a serious problem if your external is called often.
However, if your external has an initialization routine and a close routine
that is called before and after all your other routines, you can call
EnterMovies in the initialization routine, and then call ExitMovies in your
close routine. Of course, each of the routines called in between could call
either EnterMovies and ExitMovies, or not call either of them at all, depending
on your implementation.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help